package service

import (
	"gitee.com/legend9999/publisher/dao"
	"gitee.com/legend9999/publisher/modle"
)

type UserService int

var userDAO dao.UserDAO

func (u *UserService) Query() ([]*modle.User, error) {
	return userDAO.Query()
}
func (u *UserService) QueryByLoginName(loginName string) (*modle.User, error) {
	return userDAO.QueryByLoginName(loginName)
}

func (u UserService) Create(user *modle.User) error {
	user.Role = 2
	return userDAO.Create(user)
}
func (u UserService) Update(user *modle.User) error {
	return userDAO.Update(user)
}
